﻿@using Orchard.ContentManagement
@using SkautSIS.Users.Extensions

@{
    var userCanRegister = WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().UsersCanRegister;
    var enableLostPassword = WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().EnableLostPassword;
}

<h1 class="page-title">@Html.TitleForPage((string)Model.Title)</h1>
<p>
    @T("Please sign in using one of the offered methods.")
</p>
@Html.ValidationSummary(T("Login was unsuccessful. Please correct the errors and try again.").ToString())

@using (Html.BeginFormAntiForgeryPost(Url.SkautIsLogOn(), FormMethod.Get)) {
    <input type="hidden" name="ReturnUrl" value="@Request.QueryString["ReturnUrl"]" />
    <fieldset class="login-form group">
        <legend>@T("SkautIS Account")</legend>
        <p>
            @T("To sign in using your SkautIS account, click on the button below.")
            @Html.Link(T("Register").Text, Url.SkautIsRegister())@T(" if you don't have an account.")
        </p>
        <input class="primaryAction" type="submit" value="@T("Sign In with SkautIS Account")" />
    </fieldset>
}

@using (Html.BeginFormAntiForgeryPost(Url.LogOn())) {
<input type="hidden" name="ReturnUrl" value="@Request.QueryString["ReturnUrl"]" />
<fieldset class="login-form group">
    <legend>@T("Local User Account")</legend>
    <p>
        @T("To sign in using your local user account, fill in your username and password.")
        @if(userCanRegister) { @Html.Link(T("Register").Text, Url.LocalRegister()) @T(" if you don't have an account.") }
        @if(enableLostPassword) { <text> </text> @Html.ActionLink(T("Lost your Password?").Text, "RequestLostPassword") }
    </p>
    <ol>
        <li>
            <label for="username-email">@T("Username")</label>
            @Html.TextBox("userNameOrEmail", "", new { id = "username-email", autofocus = "autofocus" })
            @Html.ValidationMessage("userNameOrEmail")
        </li>
        <li>
            <label for="password">@T("Password")</label>
            @Html.Password("password")
            @Html.ValidationMessage("password")
        </li>
        <li>
            @Html.CheckBox("rememberMe", new { id = "remember-me" })<label class="forcheckbox" for="remember-me">@T("Remember Me")</label>
        </li>
    </ol>
    <button class="primaryAction" type="submit">@T("Sign In with Local Account")</button>
</fieldset>
}